/*package com.wooophone.mpyeah.test;

import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;

import java.util.List;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;

import com.wooophone.mpyeah.biz.BrandBiz;
import com.wooophone.mpyeah.biz.BrandCommentBiz;
import com.wooophone.mpyeah.biz.BrandCommentReplyBiz;
import com.wooophone.mpyeah.biz.exception.CannotDeleteException;
import com.wooophone.mpyeah.entity.Brand;
import com.wooophone.mpyeah.entity.BrandComment;
import com.wooophone.mpyeah.entity.BrandCommentReply;

@ContextConfiguration(locations = { "/spring/applicationContext*.xml" })
public class BrandCommentBizTestCase extends AbstractJUnit4SpringContextTests{
	
	@Autowired
	BrandCommentBiz brandCommentBiz;
	@Autowired
	BrandBiz brandBiz;
	@Autowired
	BrandCommentReplyBiz brandCommentReplyBiz;
	
	@Test
	public void testUse(){
		brandCommentBiz.uselessPlusOne("073edc65293111e188d2c6f783a8c3d9");
	}
	
	@Test
	public void testUpdate(){
		
//		List<BrandComment> list = brandCommentBiz.list();
		
//		List<Map<String, Object>> grades=new ArrayList<Map<String,Object>>();
		
//		Map<String, Object> map=new HashMap<String, Object>();
//		map.put("lable", "材质");
//		map.put("value", 4);
//		grades.add(map);
		
//		map=new HashMap<String, Object>();
//		map.put("lable", "售后");
//		map.put("value", 3);
//		grades.add(map);
		
//		List<Object[]> grades=new ArrayList<Object[]>();
//		Object[] objects=new Object[]{"材质",1};
//		grades.add(objects);
//		objects=new Object[]{"售后",2};
//		grades.add(objects);
//		
//		
//		for (BrandComment brandComment : list) {
//			brandComment.setGrade(JsonSfUtil.toJsonByJsonLib(grades));
//			brandCommentBiz.update(brandComment);
//		}
		
	}
	
	@Test
	public void test(){
		Brand brand=new Brand();
		brand.setName("华硕");
		brandBiz.save(brand);
		
		assertThat(brand.getId()!=null, is(true));
		
		BrandComment brandComment=new BrandComment();
		
		brandComment.setBrand(brand);
		brandComment.setBrandId(brand.getId());
		brandComment.setContent("测试：华硕是个好东西");
		brandComment.setCreator("minglic");
		brandComment.setLevel(1);
		brandComment.setImpression("还不错");
		brandComment.setTitle("test:title");
		brandComment.setVoteWell(0);
		brandComment.setVoteBad(0);
		brandComment.setStatus(0);
		
		brandCommentBiz.save(brandComment);
		assertThat(brandComment.getId()!=null, is(true));
		
		BrandCommentReply brandCommentReply=new BrandCommentReply();
		brandCommentReply.setContent("评论内容");
		brandCommentReply.setCommentId(brandComment.getId());
		brandCommentReplyBiz.save(brandCommentReply);
		assertThat(brandCommentReply.getId()!=null, is(true));

		
		BrandComment brandComment2 = brandCommentBiz.get(brandComment.getId());
		System.out.println("-------id="+brandComment2.getBrand().getId());
		System.out.println("-------reply.size="+brandComment2.getReplys().size());
		
		List<BrandComment> list = brandCommentBiz.list();
		System.out.println("size:"+list.size());
		
		
		try {
			brandCommentReplyBiz.delete(brandCommentReply.getId());
			brandCommentBiz.delete(brandComment.getId());
			brandBiz.delete(brand.getId());
		} catch (CannotDeleteException e) {
			e.printStackTrace();
		}
		
	}
	
}
*/